<?php
/**
 * Created by PhpStorm.
 * User: Jerry
 * Date: 2017/1/16
 * Time: 13:52
 */

namespace YMApi\Controller;


/**
 * Class NavController
 * @package SDXApi\Controller
 */
class NavController extends AppController
{
	/**
	 * Created by Jerry
	 */
	public function get_nav()
	{
		$navModel = D('TouchNav');
		$navData = $navModel->get_touch_nav_list();

		$countNumber = count($navData);

		if (empty($navData)) {
			returnApiError('暂无数据');
		}

		$data = array(
			'total'		=>	$countNumber,
			'data'		=>	$navData,
			'is_show'	=>	1,
		);

		if ($countNumber <= 1) {
			$data['is_show'] = 0;
		}

		returnApiSuccess($data);
	}
}